﻿namespace FileTransferSystem.Utilities
{
    /// <summary>
    /// 路径处理工具类
    /// </summary>
    public static class PathHelper
    {
        /// <summary>
        /// 清理路径字符串，移除引号并统一路径分隔符
        /// </summary>
        public static string CleanPath(string path)
        {
            if (string.IsNullOrEmpty(path))
                return path;

            // 移除中文和英文引号
            path = path.Trim('"', '“', '”');

            // 统一路径分隔符
            if (Path.DirectorySeparatorChar == '/')
            {
                path = path.Replace('\\', '/');
            }
            else
            {
                path = path.Replace('/', '\\');
            }

            return path;
        }
    }
}